#include "cmenu.h"

cMenu::cMenu()
{
    //ctor
}

cMenu::~cMenu()
{
    //dtor
}

void cMenu::Clear()
{
    Items.clear();
}

void cMenu::AddItem(std::string Item)
{
    Items.push_back(Item);
}

int cMenu::GetItem()
{
    unsigned int x;
    int option=-1;
    for(x=0;x<Items.size();x++)
        {
            cout<< x <<Items.at(x)<<endl;
        }
    cout << "Choose the option and press enter" << endl;
while(option<0)
{
cin >> option;
//cout << endl << "you choosed: "<< option << endl;
if ((option+1)>Items.size()){option=-1;}
}
return option;
}

